import request from 'umi-request';

export async function queryContractDayList(params,index = {}) {
  return request('/hr-ssc/api/api-admin/eSign/getContractUrlPage', {
    method: 'post',
    data: {
      pageNum: params.current,
      pageSize: params.pageSize,
      isUpcoming:parseInt(index) === 1?true:false,
      blurName:params.name,
      type:params.type,
      signedTimeStart:params.beginDate,
      signedTimeEnd:params.endDate,
      status:params.status
    },
  }).then((res) => {
    if (res.flag) {
      const data = res.data;
      return {
        current: data.currPage,
        data: data.list,
        pageSize: data.pageSize,
        success: true,
        total: data.totalCount,
      };
    } else {
      return {};
    }
  });
}

export async function terminationContract(id) {
  return request('/hr-ssc/api/api-admin/eSign/updateContractUrlStatus', {
    method: 'POST',
    data: {
      id:id,
      status:4
    },
    requestType: 'form'
  }).then((res) => {
    return res;
  });
}
